<template>
  <div>
      <template v-if="checkDataType(menus) === 'Array'">
        <div v-for="menu in menus" :key="menu.name">
          <el-submenu v-if="menu.menuType === '0' && menu.status === '0' && menu.children && menu.children.length > 0" :index="menu.menuPath + ''">
            <template slot="title">
              <i :class="menu.menuIcon"></i>
              <span class="menuSpan">{{menu.menuName}}</span>
            </template>
            <MenuContent :menus="menu.children"></MenuContent>
          </el-submenu>
          <el-menu-item v-else-if="menu.menuType === '1' && menu.status === '0'" :index="menu.menuPath + ''">
            <i :class="menu.menuIcon"></i>
            <span class="menuSpan">{{ menu.menuName }}</span>
          </el-menu-item>
        </div>
      </template>

  </div>
</template>

<script>
export default {
    name: "MenuContent",
    props: ['menus'],
    data() {
        return {

        }
    },
    methods: {
        checkDataType(data) {
            return Object.prototype.toString.call(data).slice(8, -1);
        }
  }

}
</script>

<style>

</style>
